import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/1',
      name: '自定义table表展示列',
      meta:{
        title:"自定义table表展示列"
      },
      component: () => import('../views/el-table鼠标放入触发行事件及自定义列.vue')
    },
    {
      path: '/2',
      name: '下载excel',
      meta:{
        title:"下载excel"
      },
      component: () => import('../views/纯前端实现excel模板下载.vue')
    },
    {
      path: '/3',
      name: '雪花飘落',
      meta:{
        title:"雪花飘落"
      },
      component: () => import('../views/雪花飘落')
    },
    {
      path: '/4',
      name: '日期差判断',
      meta:{
        title:"日期差判断"
      },
      component: () => import('../views/日期差判断')
    },
    {
      path: '/5',
      name: '导出zip功能',
      meta:{
        title:"导出zip功能"
      },
      component: () => import('../views/导出zip功能')
    },
    {
      path: '/6',
      name: '拖拽',
      meta:{
        title:"拖拽"
      },
      component: () => import('../views/拖拽')
    },
    {
      path: '/7',
      name: '保存音乐',
      meta:{
        title:"保存音乐"
      },
      component: () => import('../views/保存音乐')
    },
    {
      path: '/8',
      name: '短信验证码输入功能',
      meta:{
        title:"短信验证码输入功能"
      },
      component: () => import('../views/短信验证码输入功能')
    },
    {
      path: '/9',
      name: '区域loading加载功能',
      meta:{
        title:"区域loading加载功能"
      },
      component: () => import('../views/区域loading加载功能')
    },
    {
      path: '/10',
      name: '后台获取音乐',
      meta:{
        title:"后台获取音乐"
      },
      component: () => import('../views/后台获取音乐')
    },
    {
      path: '/11',
      name: '多图片存储',
      meta:{
        title:"多图片存储"
      },
      component: () => import('../views/图片存储')
    },
    {
      path: '/12',
      name: '视频播放',
      meta:{
        title:"视频播放"
      },
      component: () => import('../views/video')
    },
    {
      path: '/13',
      name: '复制功能',
      meta:{
        title:"复制功能"
      },
      component: () => import('../views/复制功能')
    },
    {
      path: '/14',
      name: '图片转base64',
      meta:{
        title:"图片转base64"
      },
      component: () => import('../views/图片转base64')
    },
    {
      path: '/15',
      name: 'excel导入导出模板下载',
      meta:{
        title:"excel导入导出模板下载"
      },
      component: () => import('../views/excel导入导出模板下载')
    },
    {
      path: '/',
      name: '区域坐标',
      meta:{
        title:"区域坐标"
      },
      component: () => import('../views/区域坐标')
    },
  ],
  mode: 'history',  //去掉url后面的"#/"
})


router.afterEach((to, from) => {
  document.title = to.meta.title //在全局后置守卫中获取路由元信息设置title
})


export default router
